<%@ Page Language="C#" MasterPageFile="~/admin/admin1.master" AutoEventWireup="true" CodeFile="Links.aspx.cs" Inherits="admin_Pages_links" Title="Links" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphAdmin" runat="Server">

<br />
 
<div class="settings">
  
  <h1 style="margin: 0 0 5px 0"><%=Resources.labels.edit + " " + Resources.labels.link%> </h1>

  <label for="<%=txtTitle.ClientID %>" class="wide"><%=Resources.labels.title %></label>
  <asp:TextBox runat="server" ID="txtTitle" Width="600px" />
  <asp:CustomValidator runat="Server" ID="valExist" ValidationGroup="new" ControlToValidate="txtTitle" ErrorMessage="The category already exists" Display="dynamic" />
  <asp:RequiredFieldValidator ID="titleValidator" runat="Server" ValidationGroup="new" ControlToValidate="txtTitle" ErrorMessage="required" /><br />

  <label for="<%=txtSlug.ClientID %>" class="wide"><%=Resources.labels.slug %></label>
  <asp:TextBox runat="server" ID="txtSlug" Width="600px" />
  <asp:RequiredFieldValidator ID="slugValidator" runat="Server" ControlToValidate="txtSlug" ErrorMessage="required" /><br />
  
  <label for="<%=txtDescription.ClientID %>" class="wide"><%=Resources.labels.description %></label>
  <asp:TextBox runat="server" ID="txtDescription" Width="600px" TextMode="multiLine" Rows="3" Columns="60" />
  <asp:RequiredFieldValidator ID="descriptionValidator" runat="Server" ControlToValidate="txtDescription" ErrorMessage="required" /><br />
  
  <label for="<%=txtWebUrl.ClientID %>" class="wide"><%=Resources.labels.website %></label>
  <asp:TextBox runat="server" ID="txtWebUrl" Width="600px" />
  <asp:RequiredFieldValidator ID="websiteValidator" runat="Server" ControlToValidate="txtWebUrl" ErrorMessage="required" /><br />
  
  <label for="<%=txtFeedUrl.ClientID %>" class="wide"><%=Resources.labels.feed %></label>
  <asp:TextBox runat="server" ID="txtFeedUrl" Width="600px" />
  <asp:RequiredFieldValidator ID="feedValidator" runat="Server" ControlToValidate="txtFeedUrl" ErrorMessage="required" /><br />

  <label for="<%=txtImageUrl.ClientID %>" class="wide"><%=Resources.labels.image%></label>
  <asp:TextBox runat="server" ID="txtImageUrl" Width="600px" /><br />

  <label for="<%=cbBlogRoll.ClientID %>"><%=Resources.labels.blogroll%></label>
  <asp:CheckBox runat="Server" ID="cbBlogRoll"/><br />

  <label for="<%=cbPublished.ClientID %>"><%=Resources.labels.publish %></label>
  <asp:CheckBox runat="Server" ID="cbPublished"/><br />
  
  <label for="<%=txtOrder.ClientID %>"><%=Resources.labels.order %></label>
  <asp:TextBox runat="server" ID="txtOrder" Width="50" MaxLength="4" />
  <asp:CompareValidator ID="txtOrderValidator" ValidationGroup="new" runat="server" ControlToValidate="txtOrder" Operator="DataTypeCheck" Type="integer" ErrorMessage="Please enter a valid number" /><br />

  
  <label for="<%=cblXfn.ClientID %>" class="wide">XFN tag</label>
  <asp:CheckBoxList runat="server" ID="cblXfn" CssClass="nowidth" RepeatColumns="8">
    <asp:ListItem Text="contact" />
    <asp:ListItem Text="acquaintance " />
    <asp:ListItem Text="friend " />
    <asp:ListItem Text="met" />
    <asp:ListItem Text="co-worker" />
    <asp:ListItem Text="colleague " />
    <asp:ListItem Text="co-resident" />
    <asp:ListItem Text="neighbor " />
    <asp:ListItem Text="child" />
    <asp:ListItem Text="parent" />
    <asp:ListItem Text="sibling" />
    <asp:ListItem Text="spouse" />
    <asp:ListItem Text="kin" />
    <asp:ListItem Text="muse" />
    <asp:ListItem Text="crush" />
    <asp:ListItem Text="date" />
    <asp:ListItem Text="sweetheart" />
    <asp:ListItem Text="me" />
  </asp:CheckBoxList>

  <asp:Button runat="server" ID="btnAdd" ValidationGroup="new" /><br /><hr />

  <asp:GridView runat="server" ID="grid"  
    GridLines="None"
    AutoGenerateColumns="False" 
    AlternatingRowStyle-CssClass="alt" 
    AutoGenerateDeleteButton="True">
    <Columns>  
      <asp:HyperLinkField DataNavigateUrlFields="Id" DataNavigateUrlFormatString="?id={0}" Text="Edit" >
          <ItemStyle HorizontalAlign="Center" Width="50px" />
      </asp:HyperLinkField>
      <asp:TemplateField HeaderText="<%$ Resources:labels, name %>" >
        <ItemTemplate>
          <%# Server.HtmlEncode(Eval("title").ToString()) %>
        </ItemTemplate>
          <ControlStyle Width="150px" />
          <ItemStyle Width="150px" HorizontalAlign="Left" Wrap="False" />
          <HeaderStyle Width="150px" HorizontalAlign="Left" Wrap="False" />
      </asp:TemplateField>
      <asp:TemplateField HeaderText="<%$ Resources:labels, slug %>">
        <ItemTemplate>
          <%# Server.HtmlEncode(Eval("slug").ToString()) %>
        </ItemTemplate>
          <ControlStyle Width="150px" />
          <ItemStyle Width="150px" HorizontalAlign="Left" Wrap="False" />
          <HeaderStyle Width="150px" HorizontalAlign="Left" Wrap="False" />
      </asp:TemplateField>
      <asp:TemplateField HeaderText="<%$ Resources:labels, website %>">
       <ItemTemplate>
          <%# Server.HtmlEncode(Eval("website").ToString())%>
        </ItemTemplate>
          <ControlStyle Width="150px" />
          <ItemStyle Width="150px" HorizontalAlign="Left" Wrap="False" />
          <HeaderStyle Width="150px" HorizontalAlign="Left" Wrap="False" />
      </asp:TemplateField>
      <asp:TemplateField HeaderText="<%$ Resources:labels, feed %>">
       <ItemTemplate>
          <%# Server.HtmlEncode(Eval("feed").ToString())%>
        </ItemTemplate>
          <ControlStyle Width="150px" />
          <ItemStyle Width="150px" HorizontalAlign="Left" Wrap="False" />
          <HeaderStyle Width="150px" HorizontalAlign="Left" Wrap="False" />
      </asp:TemplateField>
      <asp:CheckBoxField HeaderText="<%$ Resources:labels, blogroll %>" DataField="BlogRoll" ReadOnly="True">
          <ControlStyle Width="10px" />
          <ItemStyle Width="30px" HorizontalAlign="Center" />
          <HeaderStyle Width="30px" HorizontalAlign="Center" />
      </asp:CheckBoxField>
      <asp:CheckBoxField HeaderText="<%$ Resources:labels, published %>" DataField="isPublished" ReadOnly="True">
          <ControlStyle Width="10px" />
          <ItemStyle Width="30px" HorizontalAlign="Center" />
          <HeaderStyle Width="30px" HorizontalAlign="Center" />
      </asp:CheckBoxField>
    </Columns>
      <AlternatingRowStyle CssClass="alt" />
  </asp:GridView>
  
 </div> 
</asp:Content>
